package com.fenghongzhang.day012;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

/**
 * 接收者-> 加频道
 * 1,代码-> 动态
 * 2.清单-> 静态
 */
public class MyReceiver extends BroadcastReceiver {

    private static final String TAG = "MyReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {


        Log.i(TAG, "onReceive: ");
        //是不是有序广播
        if (isOrderedBroadcast()){
            //中断广播
            abortBroadcast();
        }

        //com.feng.  com.feng1
//        String action = intent.getAction();
//        if(action.equals("com.feng")){
//            Bundle extras = intent.getExtras();
//            String name = extras.getString("name");
//            Log.i(TAG, "onReceive: "+name);
//        }else if(action.equals("com.feng1")){
//            Bundle extras = intent.getExtras();
//            String name1 = extras.getString("name1");
//            Log.i(TAG, "onReceive: "+name1);
//        }
    }
}
